\doxysection{my\+\_\+tree\texorpdfstring{$<$}{<} T \texorpdfstring{$>$}{>} Class Template Reference}
\hypertarget{classmy__tree}{}\label{classmy__tree}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}


二叉树类（模板类，支持任意数据类型\+T）  




{\ttfamily \#include $<$my\+\_\+tree.\+h$>$}

\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classmy__tree_a9c79fe45a5aae4cbb2efbc5bb050a135}{my\+\_\+tree}} (T val=0)
\begin{DoxyCompactList}\small\item\em 构造函数 \end{DoxyCompactList}\item 
int \mbox{\hyperlink{classmy__tree_ab1c9be9f0c6b3fee4b3322841014b8a3}{get\+\_\+root}} ()
\begin{DoxyCompactList}\small\item\em 树的根的编号 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classmy__tree_af25baab5cde301d7087d8c5f63727a8f}{get\+\_\+children}} (vector$<$ int $>$ \&children, int root)
\begin{DoxyCompactList}\small\item\em 把某个节点对应的直接的孩子们压入向量中 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classmy__tree_a225822fd474ed642ee22901b918bd759}{get\+\_\+children}} (queue$<$ int $>$ \&children, int root)
\begin{DoxyCompactList}\small\item\em 把某个节点对应的直接的孩子们压入队列中 \end{DoxyCompactList}\item 
int \mbox{\hyperlink{classmy__tree_a532dfbc3d3835014944957a61b7a8bce}{get\+\_\+height}} (int index)
\begin{DoxyCompactList}\small\item\em 得到树高 \end{DoxyCompactList}\item 
int \mbox{\hyperlink{classmy__tree_a6d1fb6a1cb4a9064cb2538d1fbaa8b06}{get\+\_\+height}} ()
\begin{DoxyCompactList}\small\item\em 得到树高 \end{DoxyCompactList}\item 
int \mbox{\hyperlink{classmy__tree_a2cef5c6b97d67ca6a49b0577600f5254}{get\+\_\+h\+\_\+layer\+\_\+nodes}} (int h)
\begin{DoxyCompactList}\small\item\em 得到h层的节点数 \end{DoxyCompactList}\item 
int \mbox{\hyperlink{classmy__tree_a3b2c0f604e05f25ffd37a6d0f45a2a26}{get\+\_\+last\+\_\+layer\+\_\+nodes}} ()
\begin{DoxyCompactList}\small\item\em 得到最后一层的节点数 \end{DoxyCompactList}\item 
int \mbox{\hyperlink{classmy__tree_a826f12f2e9f55f7436fa8d3e1d41da93}{get\+\_\+nodes\+\_\+nums}} ()
\begin{DoxyCompactList}\small\item\em 树的总节点数 \end{DoxyCompactList}\item 
T \mbox{\hyperlink{classmy__tree_afbfe59f624cf7f8a7f8ebb3cc9ad4514}{get\+\_\+value}} ()
\begin{DoxyCompactList}\small\item\em 打印根节点值 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classmy__tree_a00b270f7f42b067702dadafc78f04bf6}{show\+\_\+k\+\_\+node}} (int k)
\begin{DoxyCompactList}\small\item\em 打印第k个 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classmy__tree_a0d6043fc3e177a775f837fc9dfaea31a}{insert}} (\mbox{\hyperlink{struct_tree_node}{Tree\+Node}}$<$ T $>$ node)
\begin{DoxyCompactList}\small\item\em 插入新节点 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classmy__tree_a49e765fa53962f4ce7d11d6cdb8a12ad}{show\+\_\+binary\+\_\+tree\+\_\+with\+\_\+root}} (string mode, int root)
\begin{DoxyCompactList}\small\item\em 打印根和他的所有孩子 \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classmy__tree_a0020d5a85f5d99734466c6ef5d255b72}{show\+\_\+binary\+\_\+tree}} (string mode)
\begin{DoxyCompactList}\small\item\em 遍历打印 \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Function$>$ }\\void \mbox{\hyperlink{classmy__tree_aadec19d1d256df1f27412e80bd6579d1}{traversal\+\_\+binary\+\_\+tree\+\_\+with\+\_\+root}} (string mode, int root, Function F)
\begin{DoxyCompactList}\small\item\em 打印根和他的所有孩子 \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Function$>$ }\\void \mbox{\hyperlink{classmy__tree_a99d1637e88625af9f06b6d020730f634}{traversal\+\_\+binary\+\_\+tree}} (string mode, Function F)
\begin{DoxyCompactList}\small\item\em 遍历打印 \end{DoxyCompactList}\item 
T \mbox{\hyperlink{classmy__tree_a908b1d95027e3afb39e7e33b59de10b9}{operator\mbox{[}$\,$\mbox{]}}} (int index)
\begin{DoxyCompactList}\small\item\em 操作符重载\mbox{[}\mbox{]} \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
ostream \& \mbox{\hyperlink{classmy__tree_aa1da950e13ff2a3c6fcaca11015a4e20}{operator$<$$<$}} (ostream \&os, \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$ Tree)
\begin{DoxyCompactList}\small\item\em 操作符重载\texorpdfstring{$<$}{<}\texorpdfstring{$<$}{<} \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classmy__tree_a9aa06543930fa8ddb21c1ebabbff3ecf}{print\+\_\+node}} (\mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$ Tree, int x)
\begin{DoxyCompactList}\small\item\em 打印节点，后续用来bind之后传入traversal \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\subsubsection*{template$<$typename T$>$\newline
class my\+\_\+tree$<$ T $>$}
二叉树类（模板类，支持任意数据类型\+T） 


\begin{DoxyTemplParams}{Template Parameters}
{\em T} & 二叉树节点存储的数据类型 \\
\hline
\end{DoxyTemplParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 

这样感觉好一点 
\end{DoxyNote}


\label{doc-constructors}
\Hypertarget{classmy__tree_doc-constructors}
\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{classmy__tree_a9c79fe45a5aae4cbb2efbc5bb050a135}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!my\_tree@{my\_tree}}
\index{my\_tree@{my\_tree}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{my\_tree()}{my\_tree()}}
{\footnotesize\ttfamily \label{classmy__tree_a9c79fe45a5aae4cbb2efbc5bb050a135} 
template$<$typename T$>$ \\
\mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\mbox{\hyperlink{classmy__tree}{\+::my\+\_\+tree}} (\begin{DoxyParamCaption}\item[{T}]{val}{ = {\ttfamily 0}}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



构造函数 


\begin{DoxyParams}{Parameters}
{\em val} & 当前节点值 \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}


\label{doc-func-members}
\Hypertarget{classmy__tree_doc-func-members}
\doxysubsection{Member Function Documentation}
\Hypertarget{classmy__tree_a225822fd474ed642ee22901b918bd759}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!get\_children@{get\_children}}
\index{get\_children@{get\_children}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{get\_children()}{get\_children()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classmy__tree_a225822fd474ed642ee22901b918bd759} 
template$<$typename T$>$ \\
void \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::get\+\_\+children (\begin{DoxyParamCaption}\item[{queue$<$ int $>$ \&}]{children}{, }\item[{int}]{root}{}\end{DoxyParamCaption})}



把某个节点对应的直接的孩子们压入队列中 


\begin{DoxyParams}{Parameters}
{\em children} & 压入的队列 \\
\hline
{\em root} & 某个节点 \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_af25baab5cde301d7087d8c5f63727a8f}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!get\_children@{get\_children}}
\index{get\_children@{get\_children}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{get\_children()}{get\_children()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classmy__tree_af25baab5cde301d7087d8c5f63727a8f} 
template$<$typename T$>$ \\
void \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::get\+\_\+children (\begin{DoxyParamCaption}\item[{vector$<$ int $>$ \&}]{children}{, }\item[{int}]{root}{}\end{DoxyParamCaption})}



把某个节点对应的直接的孩子们压入向量中 


\begin{DoxyParams}{Parameters}
{\em children} & 压入的向量 \\
\hline
{\em root} & 某个节点 \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a2cef5c6b97d67ca6a49b0577600f5254}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!get\_h\_layer\_nodes@{get\_h\_layer\_nodes}}
\index{get\_h\_layer\_nodes@{get\_h\_layer\_nodes}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{get\_h\_layer\_nodes()}{get\_h\_layer\_nodes()}}
{\footnotesize\ttfamily \label{classmy__tree_a2cef5c6b97d67ca6a49b0577600f5254} 
template$<$typename T$>$ \\
int \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::get\+\_\+h\+\_\+layer\+\_\+nodes (\begin{DoxyParamCaption}\item[{int}]{h}{}\end{DoxyParamCaption})}



得到h层的节点数 


\begin{DoxyParams}{Parameters}
{\em h} & h层 \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a6d1fb6a1cb4a9064cb2538d1fbaa8b06}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!get\_height@{get\_height}}
\index{get\_height@{get\_height}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{get\_height()}{get\_height()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classmy__tree_a6d1fb6a1cb4a9064cb2538d1fbaa8b06} 
template$<$typename T$>$ \\
int \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::get\+\_\+height (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})}



得到树高 

\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a532dfbc3d3835014944957a61b7a8bce}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!get\_height@{get\_height}}
\index{get\_height@{get\_height}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{get\_height()}{get\_height()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classmy__tree_a532dfbc3d3835014944957a61b7a8bce} 
template$<$typename T$>$ \\
int \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::get\+\_\+height (\begin{DoxyParamCaption}\item[{int}]{index}{}\end{DoxyParamCaption})}



得到树高 

\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a3b2c0f604e05f25ffd37a6d0f45a2a26}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!get\_last\_layer\_nodes@{get\_last\_layer\_nodes}}
\index{get\_last\_layer\_nodes@{get\_last\_layer\_nodes}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{get\_last\_layer\_nodes()}{get\_last\_layer\_nodes()}}
{\footnotesize\ttfamily \label{classmy__tree_a3b2c0f604e05f25ffd37a6d0f45a2a26} 
template$<$typename T$>$ \\
int \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::get\+\_\+last\+\_\+layer\+\_\+nodes (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})}



得到最后一层的节点数 

\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a826f12f2e9f55f7436fa8d3e1d41da93}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!get\_nodes\_nums@{get\_nodes\_nums}}
\index{get\_nodes\_nums@{get\_nodes\_nums}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{get\_nodes\_nums()}{get\_nodes\_nums()}}
{\footnotesize\ttfamily \label{classmy__tree_a826f12f2e9f55f7436fa8d3e1d41da93} 
template$<$typename T$>$ \\
int \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::get\+\_\+nodes\+\_\+nums (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})}



树的总节点数 

\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_ab1c9be9f0c6b3fee4b3322841014b8a3}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!get\_root@{get\_root}}
\index{get\_root@{get\_root}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{get\_root()}{get\_root()}}
{\footnotesize\ttfamily \label{classmy__tree_ab1c9be9f0c6b3fee4b3322841014b8a3} 
template$<$typename T$>$ \\
int \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::get\+\_\+root (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})}



树的根的编号 

\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_afbfe59f624cf7f8a7f8ebb3cc9ad4514}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!get\_value@{get\_value}}
\index{get\_value@{get\_value}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{get\_value()}{get\_value()}}
{\footnotesize\ttfamily \label{classmy__tree_afbfe59f624cf7f8a7f8ebb3cc9ad4514} 
template$<$typename T$>$ \\
T \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::get\+\_\+value (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})}



打印根节点值 

\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a0d6043fc3e177a775f837fc9dfaea31a}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!insert@{insert}}
\index{insert@{insert}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{insert()}{insert()}}
{\footnotesize\ttfamily \label{classmy__tree_a0d6043fc3e177a775f837fc9dfaea31a} 
template$<$typename T$>$ \\
void \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::insert (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_tree_node}{Tree\+Node}}$<$ T $>$}]{node}{}\end{DoxyParamCaption})}



插入新节点 


\begin{DoxyParams}{Parameters}
{\em node被插入的新节点} & \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a908b1d95027e3afb39e7e33b59de10b9}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!operator\mbox{[}\mbox{]}@{operator[]}}
\index{operator\mbox{[}\mbox{]}@{operator[]}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{operator[]()}{operator[]()}}
{\footnotesize\ttfamily \label{classmy__tree_a908b1d95027e3afb39e7e33b59de10b9} 
template$<$typename T$>$ \\
T \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::operator\mbox{[}$\,$\mbox{]} (\begin{DoxyParamCaption}\item[{int}]{index}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



操作符重载\mbox{[}\mbox{]} 


\begin{DoxyParams}{Parameters}
{\em index} & 要索引的位置 \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a0020d5a85f5d99734466c6ef5d255b72}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!show\_binary\_tree@{show\_binary\_tree}}
\index{show\_binary\_tree@{show\_binary\_tree}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{show\_binary\_tree()}{show\_binary\_tree()}}
{\footnotesize\ttfamily \label{classmy__tree_a0020d5a85f5d99734466c6ef5d255b72} 
template$<$typename T$>$ \\
void \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::show\+\_\+binary\+\_\+tree (\begin{DoxyParamCaption}\item[{string}]{mode}{}\end{DoxyParamCaption})}



遍历打印 


\begin{DoxyParams}{Parameters}
{\em mode遍历的模式} & \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a49e765fa53962f4ce7d11d6cdb8a12ad}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!show\_binary\_tree\_with\_root@{show\_binary\_tree\_with\_root}}
\index{show\_binary\_tree\_with\_root@{show\_binary\_tree\_with\_root}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{show\_binary\_tree\_with\_root()}{show\_binary\_tree\_with\_root()}}
{\footnotesize\ttfamily \label{classmy__tree_a49e765fa53962f4ce7d11d6cdb8a12ad} 
template$<$typename T$>$ \\
void \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::show\+\_\+binary\+\_\+tree\+\_\+with\+\_\+root (\begin{DoxyParamCaption}\item[{string}]{mode}{, }\item[{int}]{root}{}\end{DoxyParamCaption})}



打印根和他的所有孩子 


\begin{DoxyParams}{Parameters}
{\em mode} & 遍历的模式 \\
\hline
{\em root} & 根 \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a00b270f7f42b067702dadafc78f04bf6}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!show\_k\_node@{show\_k\_node}}
\index{show\_k\_node@{show\_k\_node}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{show\_k\_node()}{show\_k\_node()}}
{\footnotesize\ttfamily \label{classmy__tree_a00b270f7f42b067702dadafc78f04bf6} 
template$<$typename T$>$ \\
void \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::show\+\_\+k\+\_\+node (\begin{DoxyParamCaption}\item[{int}]{k}{}\end{DoxyParamCaption})}



打印第k个 


\begin{DoxyParams}{Parameters}
{\em k} & 要打印的索引 \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a99d1637e88625af9f06b6d020730f634}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!traversal\_binary\_tree@{traversal\_binary\_tree}}
\index{traversal\_binary\_tree@{traversal\_binary\_tree}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{traversal\_binary\_tree()}{traversal\_binary\_tree()}}
{\footnotesize\ttfamily \label{classmy__tree_a99d1637e88625af9f06b6d020730f634} 
template$<$typename T$>$ \\
template$<$typename Function$>$ \\
void \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::traversal\+\_\+binary\+\_\+tree (\begin{DoxyParamCaption}\item[{string}]{mode}{, }\item[{Function}]{F}{}\end{DoxyParamCaption})}



遍历打印 


\begin{DoxyParams}{Parameters}
{\em mode遍历的模式} & \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_aadec19d1d256df1f27412e80bd6579d1}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!traversal\_binary\_tree\_with\_root@{traversal\_binary\_tree\_with\_root}}
\index{traversal\_binary\_tree\_with\_root@{traversal\_binary\_tree\_with\_root}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{traversal\_binary\_tree\_with\_root()}{traversal\_binary\_tree\_with\_root()}}
{\footnotesize\ttfamily \label{classmy__tree_aadec19d1d256df1f27412e80bd6579d1} 
template$<$typename T$>$ \\
template$<$typename Function$>$ \\
void \mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$\+::traversal\+\_\+binary\+\_\+tree\+\_\+with\+\_\+root (\begin{DoxyParamCaption}\item[{string}]{mode}{, }\item[{int}]{root}{, }\item[{Function}]{F}{}\end{DoxyParamCaption})}



打印根和他的所有孩子 


\begin{DoxyParams}{Parameters}
{\em mode} & 遍历的模式 \\
\hline
{\em root} & 根 \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}


\label{doc-related-members}
\Hypertarget{classmy__tree_doc-related-members}
\doxysubsection{Friends And Related Symbol Documentation}
\Hypertarget{classmy__tree_aa1da950e13ff2a3c6fcaca11015a4e20}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!operator$<$$<$@{operator$<$$<$}}
\index{operator$<$$<$@{operator$<$$<$}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{operator$<$$<$}{operator<<}}
{\footnotesize\ttfamily \label{classmy__tree_aa1da950e13ff2a3c6fcaca11015a4e20} 
template$<$typename T$>$ \\
ostream \& operator$<$$<$ (\begin{DoxyParamCaption}\item[{ostream \&}]{os}{, }\item[{\mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$}]{Tree}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [friend]}}



操作符重载\texorpdfstring{$<$}{<}\texorpdfstring{$<$}{<} 


\begin{DoxyParams}{Parameters}
{\em ostream} & 输出流 \\
\hline
{\em Tree} & 要输出的根 \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}
\Hypertarget{classmy__tree_a9aa06543930fa8ddb21c1ebabbff3ecf}\index{my\_tree$<$ T $>$@{my\_tree$<$ T $>$}!print\_node@{print\_node}}
\index{print\_node@{print\_node}!my\_tree$<$ T $>$@{my\_tree$<$ T $>$}}
\doxysubsubsection{\texorpdfstring{print\_node}{print\_node}}
{\footnotesize\ttfamily \label{classmy__tree_a9aa06543930fa8ddb21c1ebabbff3ecf} 
template$<$typename T$>$ \\
void print\+\_\+node (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classmy__tree}{my\+\_\+tree}}$<$ T $>$}]{Tree}{, }\item[{int}]{x}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [friend]}}



打印节点，后续用来bind之后传入traversal 


\begin{DoxyParams}{Parameters}
{\em Tree} & 要输出的根 \\
\hline
{\em x} & 要输出的第x个节点 \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
统一采用孩子双亲表示法 
\end{DoxyNote}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
my\+\_\+tree.\+h\end{DoxyCompactItemize}
